# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery :secret => 'a065cd4647ad0e6c62e0dbb7351d4b7d'
  
  def authorize
    unless User.find_by_id(session[:user_id])
      session[:original_uri]=request.request_uri
      flash[:notice]="Please log in"
      redirect_to(:controller => "login", :action => "login")
    end
  end
end
